package com.zbkj.common.model.saleroom;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.request.TransferInfoRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 调货详情对象 eb_transfer_info
 *
 * @author zkf
 * @date 2025-02-21
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_transfer_info")
@ApiModel(value = "TransferInfo对象", description = "调货信息表")
public class TransferInfo implements Serializable {
    private static final long serialVersionUID = 1234222L;

    /**
     * 调货记录表id
     */
    @ApiModelProperty(value = "调货记录表id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 1:出库2:入库
     */
    @ApiModelProperty(value = "1:出库2:入库")
    private Integer transferType;

    /**
     * 调货原因
     */
    @ApiModelProperty(value = "调货原因")
    private String transferReason;

    /**
     * 调货时间
     */
    @ApiModelProperty(value = "调货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date transferTime;

    /**
     * 调货配送中心id
     */
    @ApiModelProperty(value = "调货配送中心id")
    @NotNull(message = "调货配送中心id不能为空")
    private Integer transferRoomId;

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    private Integer productId;

    /**
     * 商品规格id
     */
    @ApiModelProperty(value = "商品规格id")
    private Integer productSpecsId;

    /**
     * 1:配送中心
     */
    @ApiModelProperty(value = "1:配送中心")
    private Integer transferMainBody = 1;

    @ApiModelProperty(value = "调货数量")
    private Integer transferNumber;

    @ApiModelProperty(value = "调货规格，库存json数据")
    private String transferJson;

    @ApiModelProperty(value = "是否确认(0:未   1:是)")
    private Integer isSure;

    @ApiModelProperty(value = "配送中心调货列表")
    @TableField(exist = false)
    @Valid
    private List<TransferInfoRequest> transferInfoRequestList;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品规格sku名称")
    private String sku;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品名称")
    private String productName;

    @TableField(exist = false)
    @ApiModelProperty(value = "门店名称")
    private String transferRoomName;
}
